home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2004 April
/
Gamestar_61_2004-04_dvdb.iso
/
DVDStar
/
Editace
/
hltp.exe
/
{app}
/
Source Code
/
CZBindMaker
/
AccountChooser.cs
< prev
next >
Wrap
Text File
|
2003-11-29
|
6KB
|
173 lines
/*
* CZ Bind Maker
*
* By: Steven Whitley (aka [CZ] Qw4z0)
*
* CZ Bind Maker is a key Bind utility for Counter-Strike 1.6
* and is distributed under the GNU Public License.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* If you need further support for this program you may visit
* http://www.bindmaker.org/ and post in the forums there for help.
*
*
* Any Changes or modifications of this source may be submitted for inclusion
* in the official release of CZ Bind Maker to Steve Whitley at support@bindmaker.org.
*
* Be sure to comment your code as follows:
*
* // [ AUTHOR ] [ DATE ]
* // [ DESCRIPTION OF THE CHANGE OR ADDITION ]
*
* */
/* ###############################################
* # Sand Bar Library License #
* ###############################################
*
* This release of SandBar is available at no charge for you to use in your freeware products
* royalty-free. This license does not allow distribution of SandBar with software that is
* sold or generates income in any way. Use of this release is subject to my name being
* displayed as a credit in the About dialog in your application. If this is unacceptable you
* will need to purchase the commercial license.
*
* When distributing this product with software where the source code is available (under
* GPL or other similar licenses) you are required to distribute this license file with the
* binary. This is to ensure other developers understand fully the terms of this release.
*
* By using, downloading or posessing this product you agree not to attempt to decompile or
* reverse engineer it in any way. Enjoy!
*
* Tim Dawson
* http://www.divil.co.uk/net/
*
* */
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using Microsoft.Win32;
namespace CZBindMaker
{
/// <summary>
/// Summary description for AccountChooser.
/// </summary>
public class AccountChooser : System.Windows.Forms.Form
{
private RegistryKey m_rKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Valve\Steam");
private DirectoryInfo[] m_list;
private System.Windows.Forms.ListBox AccountList;
private System.Windows.Forms.Button Ok;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public AccountChooser(DirectoryInfo[] list_arg)
{
this.m_list = list_arg;
InitializeComponent();
foreach(DirectoryInfo dmem in m_list)
{
this.AccountList.Items.Add(dmem.Name);
}
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
this.m_rKey.Close();
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AccountChooser));
this.AccountList = new System.Windows.Forms.ListBox();
this.Ok = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// AccountList
//
this.AccountList.Location = new System.Drawing.Point(8, 8);
this.AccountList.Name = "AccountList";
this.AccountList.Size = new System.Drawing.Size(272, 225);
this.AccountList.Sorted = true;
this.AccountList.TabIndex = 0;
this.AccountList.DoubleClick += new System.EventHandler(this.AccountList_DoubleClick);
//
// Ok
//
this.Ok.Location = new System.Drawing.Point(109, 240);
this.Ok.Name = "Ok";
this.Ok.TabIndex = 1;
this.Ok.Text = "Ok";
this.Ok.Click += new System.EventHandler(this.Ok_Click);
//
// AccountChooser
//
this.AcceptButton = this.Ok;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 272);
this.Controls.Add(this.Ok);
this.Controls.Add(this.AccountList);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AccountChooser";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = " Select an Account";
this.ResumeLayout(false);
}
#endregion
private void Ok_Click(object sender, System.EventArgs e)
{
CZBindMaker.CZBindMakerMainForm.m_configTransferPath = this.AccountList.SelectedItem.ToString();
this.DialogResult = DialogResult.OK;
}
private void AccountList_DoubleClick(object sender, System.EventArgs e)
{
Ok_Click(sender,e);
}
}
}